/**
 * @filename:PrdTaskQtyController Dec 22, 2023
 * @project Wonder Vue Admin Api  1.1.0
 * Copyright(c) 2020 Wonder Co. Ltd. 
 * All right reserved. 
 */
package com.wonder.app.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Date;
import java.util.Map;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wonder.admin.request.LogininforRequest;
import com.wonder.app.domain.PrdTaskQty;
import com.wonder.app.domain.Procure;
import com.wonder.app.request.ProcureRequest;
import com.wonder.app.service.PrdTaskQtyService;
import com.wonder.app.request.PrdTaskQtyRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.wonder.common.common.AjaxMap;
import com.wonder.common.common.AjaxResult;
import com.wonder.common.common.CommonPage;
import com.wonder.common.utils.MessageUtils;
import com.wonder.common.utils.StringUtils;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiImplicitParam;
/**   
 * 
 * <p>说明： 生产订单员工API接口层</P>
 * @version: 1.1.0
 * @author: Wonder
 * @time    Dec 22, 2023
 *
 */
@Api(tags = "生产订单员工")
@RestController
@RequestMapping("/app/PrdTaskQty")
public class PrdTaskQtyController {
	
	@Autowired
	private PrdTaskQtyService prdTaskQtyService;


	@ApiOperation(value = "员工工时信息列表")
	@RequestMapping(value = "/index", method = RequestMethod.POST)
	public Map<String,Object> index(@RequestBody PrdTaskQtyRequest prdTaskQtyRequest) {
		Page<PrdTaskQty> page = new Page<PrdTaskQty>(prdTaskQtyRequest.getPage(), prdTaskQtyRequest.getLimit());
		Map<String,Object> data = prdTaskQtyService.selectWorkTimeList(prdTaskQtyRequest, page);

		return AjaxMap.success(data);
	}

	@ApiOperation(value = "员工计件分配报表")
	@RequestMapping(value = "/get_piece_rote", method = RequestMethod.POST)
	public Map<String,Object> getPieceRote(@RequestBody PrdTaskQtyRequest prdTaskQtyRequest) {
		Page<PrdTaskQty> page = new Page<PrdTaskQty>(prdTaskQtyRequest.getPage(), prdTaskQtyRequest.getLimit());
		Map<String,Object> data = prdTaskQtyService.getPieceRote(prdTaskQtyRequest, page);

		return AjaxMap.success(data);
	}
	/**
	 * @explain 导出工时报表
	 * @param   对象参数：Logininfor
	 * @return  Map<String,Object>
	 * @author  Wonder
	 */
	@PostMapping("/dumpdata")
	@ApiOperation(value = "导出数据", notes = "作者：Wonder")
	public Map<String,Object> dumpdata(@RequestBody PrdTaskQtyRequest PrdTaskQtyRequest) {
		return prdTaskQtyService.dumpdataWorkTime(PrdTaskQtyRequest);
	}

	/**
	 * @explain 导出员工计件分配
	 * @param   对象参数：Logininfor
	 * @return  Map<String,Object>
	 * @author  Wonder
	 */
	@PostMapping("/dumpdataPiece")
	@ApiOperation(value = "导出数据", notes = "作者：Wonder")
	public Map<String,Object> dumpdataPiece(@RequestBody PrdTaskQtyRequest PrdTaskQtyRequest) {
		return prdTaskQtyService.dumpdataPiece(PrdTaskQtyRequest);
	}

}